<?php
/**
 * EDO_RelationsExistException
 * 
 * Carries a list of typeids
 * 
 * @package EDO
 * @subpackage Exceptions
 */
class EDO_RelationsExistException extends Exception
{
	protected $arrRelations = Array();
	
	/**
	 * Adds a relation to class
	 *
	 * @param integer $typeId
	 * @return boolean
	 */
	public function addRelation($typeId)
	{
		$this->arrRelations[$typeId] = $typeId;
		return true;
	}
	
	/**
	 * Sets the relation array
	 *
	 * @param Array $arrTypeids An array of typeids
	 * @return boolean
	 */
	public function setRelations($arrTypeids)
	{
		foreach($arrTypeids as $tId)
		{
			$this->addRelation($tId);
		}
		return true;
	}
	
	/**
	 * Accessor, returns the related typeids in an array
	 *
	 * @return Array
	 */
	public function getRelations()
	{
		return $this->arrRelations;
	}
}